// Tradex.Connectivity.Rithmic.h

#pragma once

#include "vcclr.h"

#include "RApi.h"
#include "NativeConnector.h"

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;
using namespace System::Xml;
using namespace System::Xml::Serialization;
using namespace RApi;	

namespace Tradex {
	namespace Connectivity {
		namespace Rithmic {

			[XmlRootAttribute (ElementName="RithmicConnection")]
			public ref class ConnectionSetup
			{
				public:
				[XmlArrayAttribute("Environment")]
				[XmlArrayItem(System::String::typeid, ElementName="Variable")]
				property array<String^>^ Environment {
					array<String^>^ get () { return _Environment; }
					void set  (array<String^>^ value) { _Environment = value; }
				}

				[XmlElementAttribute("Admin")]
				property String^ Admin {
					String^ get() { return _Admin; }
					void set (String^ value) { _Admin = value; }
				}

				[XmlElementAttribute("MarketData")]
				property String^ MarketData {
					String^ get() { return _MarketData; }
					void set (String^ value) { _MarketData = value; }
				}

				[XmlElementAttribute("TradingSystem")]
				property String^ TradingSystem {
					String^ get() { return _TradingSystem; }
					void set (String^ value) { _TradingSystem = value; }
				}

				[XmlElementAttribute("OrderRelease")]
				property String^ OrderRelease {
					String^ get() { return _OrderRelease; }
					void set (String^ value) { _OrderRelease = value; }
				}
				
				[XmlElementAttribute("IntradayHistory")]
				property String^ IntradayHistory {
					String^ get() { return _IntradayHistory; }
					void set (String^ value) { _IntradayHistory = value; }
				}

				static ConnectionSetup^ Load (String^ directory, String^ configuration);

				[System::Security::SecurityCritical ()]
				char** CreateEnvironment (String^ directory, String^ user);
				
				[System::Security::SecurityCritical ()]
				void DeleteEnvironment (char* environment []);

				private:
				array<String^>^ _Environment;
				String^ _Admin;
				String^ _MarketData;
				String^ _TradingSystem;
				String^ _OrderRelease;
				String^ _IntradayHistory;
			};

		}
	}
}